
/*
 * VentanaPrincipal.java
 *
 * Created on 03-10-2010, 01:36:00 AM
 */
package vista;

import conexionBaseDatos.*;
import javax.swing.JOptionPane;
import validaciones.*;
import modelo.*;

/**
 *
 * @author David Vallejos A
 */
public class VentanaPrincipal extends javax.swing.JFrame {

    private Propietario valida;
    private Medicamento recupera;
    private int resp;
    private String out = "";
    private String rutNuevoControl = "";
    private String nombrePacienteNuevoControl = "";
    private ModeloTablaResultados modeloTabla;
    String rutClienteEditable = "";
    StringBuilder finale = new StringBuilder();
    validacionesRegistros val = new validacionesRegistros();
    MostrarResultadosConsulta muestra = new MostrarResultadosConsulta();

    public VentanaPrincipal() {
        initComponents();
    }
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        cajaRutClienteRegistro = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        cajaNombrePaciente = new javax.swing.JTextField();
        jPanel17 = new javax.swing.JPanel();
        jLabel73 = new javax.swing.JLabel();
        cajaFechaInicioTratMasc1NuevoControl = new javax.swing.JTextField();
        jLabel74 = new javax.swing.JLabel();
        jLabel75 = new javax.swing.JLabel();
        jScrollPane8 = new javax.swing.JScrollPane();
        campoDescrNuevoControl = new javax.swing.JTextArea();
        jLabel76 = new javax.swing.JLabel();
        cajaFechaTerTratMasc1NuevoControl = new javax.swing.JTextField();
        jLabel77 = new javax.swing.JLabel();
        aceptarNroMedMasc1NuevoControl = new javax.swing.JButton();
        botonNoIngresaMedNuevoControl = new javax.swing.JButton();
        jPanel18 = new javax.swing.JPanel();
        jLabel81 = new javax.swing.JLabel();
        cajaTotalConsultaMasc1NuevoControl = new javax.swing.JTextField();
        jLabel82 = new javax.swing.JLabel();
        selectorFormaPagoMasc1NuevoControl = new javax.swing.JComboBox();
        jLabel83 = new javax.swing.JLabel();
        cajaFechaFacturaMasc1NuevoControl = new javax.swing.JTextField();
        jLabel84 = new javax.swing.JLabel();
        aceptarRegistroMasc1NuevoControl = new javax.swing.JButton();
        cancelarNuevoControl = new javax.swing.JButton();
        botonAceptarNuevoControl = new javax.swing.JButton();
        botonCancelarNuevoControl = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel4 = new javax.swing.JLabel();
        jPanel13 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        cajaRutEdiciónDatos = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        selectorOpcionesRegistro = new javax.swing.JComboBox();
        botonAceptarOpcionesEdicionDatos = new javax.swing.JButton();
        BotonCancelarOpcionesRegistro = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jPanel19 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        cajaFiltraRutTratamientos = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        botonAceptaRutMuestraControles = new javax.swing.JButton();
        botonCancelaRutUltimosControles = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jLabel26 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        CajaNombreProp = new javax.swing.JTextField();
        jLabel55 = new javax.swing.JLabel();
        cajaApPaternoPropMasc = new javax.swing.JTextField();
        jLabel56 = new javax.swing.JLabel();
        cajaApMaternoPropMasc = new javax.swing.JTextField();
        jLabel45 = new javax.swing.JLabel();
        cajaRutPropMasc = new javax.swing.JTextField();
        jLabel47 = new javax.swing.JLabel();
        cajaDireccionPropMasc = new javax.swing.JTextField();
        jLabel57 = new javax.swing.JLabel();
        cajaTelefonoPropMasc = new javax.swing.JTextField();
        jPanel8 = new javax.swing.JPanel();
        jLabel23 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        CajaNombreMasc = new javax.swing.JTextField();
        jLabel48 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        cajaRazaMasc = new javax.swing.JTextField();
        cajaEdadMasc = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        cajaAlimMasc = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        selectorInscritoMasc = new javax.swing.JComboBox();
        selectorVacunasMasc = new javax.swing.JComboBox();
        selectorTipoEdadMasc = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        selectorTipoAnimal = new javax.swing.JComboBox();
        jPanel16 = new javax.swing.JPanel();
        jLabel68 = new javax.swing.JLabel();
        cajaTotalConsultaMasc = new javax.swing.JTextField();
        jLabel69 = new javax.swing.JLabel();
        selectorFormaPagoMasc = new javax.swing.JComboBox();
        jLabel70 = new javax.swing.JLabel();
        cajaFechaFacturaMasc = new javax.swing.JTextField();
        jLabel71 = new javax.swing.JLabel();
        aceptarRegistroMasc = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jPanel15 = new javax.swing.JPanel();
        jLabel59 = new javax.swing.JLabel();
        jLabel60 = new javax.swing.JLabel();
        cajaFechaInicioTratMasc = new javax.swing.JTextField();
        jLabel61 = new javax.swing.JLabel();
        jLabel62 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        campoDescr = new javax.swing.JTextArea();
        jLabel63 = new javax.swing.JLabel();
        cajaFechaTerTratMasc = new javax.swing.JTextField();
        aceptarNroMedMasc = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        botonNoIngresaMed = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable1);

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(jTable2);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Gestión registro atención veterinaria \"El Peluca\"");
        setBackground(new java.awt.Color(255, 255, 255));

        jPanel6.setBackground(new java.awt.Color(244, 241, 226));

        jPanel7.setBackground(new java.awt.Color(255, 255, 255));
        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel3.setText("REGISTRO DE CONTROLES CLIENTE VETERINARIA EL PELUCA");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(479, 479, 479)
                .addComponent(jLabel3)
                .addContainerGap(491, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jLabel3)
                .addContainerGap(28, Short.MAX_VALUE))
        );

        jPanel9.setBackground(new java.awt.Color(255, 255, 255));
        jPanel9.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel5.setText("Rut Cliente:");

        cajaRutClienteRegistro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cajaRutClienteRegistroActionPerformed(evt);
            }
        });

        jLabel6.setText("Nombre Paciente:");

        jPanel17.setBackground(new java.awt.Color(255, 255, 255));

        jLabel73.setText("Inicio:");

        jLabel74.setText("Descripción");

        jLabel75.setText("tratamiento");

        campoDescrNuevoControl.setColumns(20);
        campoDescrNuevoControl.setRows(5);
        jScrollPane8.setViewportView(campoDescrNuevoControl);

        jLabel76.setText("Término:");

        jLabel77.setText("¿Ingresar Medicamentos?");

        aceptarNroMedMasc1NuevoControl.setText("si");
        aceptarNroMedMasc1NuevoControl.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarNroMedMasc1NuevoControlActionPerformed(evt);
            }
        });

        botonNoIngresaMedNuevoControl.setText("no");
        botonNoIngresaMedNuevoControl.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonNoIngresaMedNuevoControlActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel75)
                    .addComponent(jLabel74)
                    .addComponent(jLabel73))
                .addGap(36, 36, 36)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 775, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel77)
                                .addGap(53, 53, 53))
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(80, 80, 80)
                                .addComponent(aceptarNroMedMasc1NuevoControl)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(botonNoIngresaMedNuevoControl)
                                .addGap(62, 62, 62))))
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addComponent(cajaFechaInicioTratMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel76)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cajaFechaTerTratMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel17Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel73)
                    .addComponent(cajaFechaInicioTratMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel76)
                    .addComponent(cajaFechaTerTratMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel17Layout.createSequentialGroup()
                        .addComponent(jLabel77)
                        .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(23, 23, 23)
                                .addComponent(jLabel74)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel75))
                            .addGroup(jPanel17Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(botonNoIngresaMedNuevoControl)
                                    .addComponent(aceptarNroMedMasc1NuevoControl)))))
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(81, 81, 81))
        );

        jPanel18.setBackground(new java.awt.Color(254, 254, 254));

        jLabel81.setText("Total Consulta:");

        cajaTotalConsultaMasc1NuevoControl.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cajaTotalConsultaMasc1NuevoControlActionPerformed(evt);
            }
        });

        jLabel82.setText("Forma de pago:");

        selectorFormaPagoMasc1NuevoControl.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "efectivo", "cheque", "tarjeta crédito" }));

        jLabel83.setText("Fecha emisión:");

        jLabel84.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
        jLabel84.setText("¿Ingresar Paciente?");

        aceptarRegistroMasc1NuevoControl.setText("aceptar");
        aceptarRegistroMasc1NuevoControl.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarRegistroMasc1NuevoControlActionPerformed(evt);
            }
        });

        cancelarNuevoControl.setText("cancelar");
        cancelarNuevoControl.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelarNuevoControlActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel18Layout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel81)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cajaTotalConsultaMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel82)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(selectorFormaPagoMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(jLabel83)
                .addGap(18, 18, 18)
                .addComponent(cajaFechaFacturaMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel84)
                .addGap(22, 22, 22)
                .addComponent(aceptarRegistroMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(cancelarNuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(41, 41, 41))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel18Layout.createSequentialGroup()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(selectorFormaPagoMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel83)
                    .addComponent(cajaFechaFacturaMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(aceptarRegistroMasc1NuevoControl)
                    .addComponent(cancelarNuevoControl)
                    .addComponent(cajaTotalConsultaMasc1NuevoControl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel81)
                    .addComponent(jLabel82)
                    .addComponent(jLabel84))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        botonAceptarNuevoControl.setText("aceptar");
        botonAceptarNuevoControl.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAceptarNuevoControlActionPerformed(evt);
            }
        });

        botonCancelarNuevoControl.setText("cancelar");
        botonCancelarNuevoControl.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonCancelarNuevoControlActionPerformed(evt);
            }
        });

        jLabel4.setText("Ingrese los datos a buscar");

        jPanel13.setBackground(new java.awt.Color(255, 255, 255));

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel13.setText("Edición datos");

        jLabel14.setText("Ingrese rut:");

        jLabel15.setText("Seleccionar la opción a realizar:");

        selectorOpcionesRegistro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "editar datos cliente", "editar datos paciente", "eliminar registros" }));

        botonAceptarOpcionesEdicionDatos.setText("aceptar");
        botonAceptarOpcionesEdicionDatos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAceptarOpcionesEdicionDatosActionPerformed(evt);
            }
        });

        BotonCancelarOpcionesRegistro.setText("cancelar");
        BotonCancelarOpcionesRegistro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonCancelarOpcionesRegistroActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGap(192, 192, 192)
                        .addComponent(jLabel13))
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel13Layout.createSequentialGroup()
                                .addComponent(jLabel15)
                                .addGap(18, 18, 18)
                                .addComponent(selectorOpcionesRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel13Layout.createSequentialGroup()
                                .addComponent(jLabel14)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(cajaRutEdiciónDatos)))))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(botonAceptarOpcionesEdicionDatos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BotonCancelarOpcionesRegistro, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(91, 91, 91))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .addComponent(jLabel13)
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cajaRutEdiciónDatos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(botonAceptarOpcionesEdicionDatos))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(BotonCancelarOpcionesRegistro)
                    .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel15)
                        .addComponent(selectorOpcionesRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );

        jPanel19.setBackground(new java.awt.Color(255, 255, 255));

        jLabel16.setText("Ingrese Rut:");

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel17.setText("Mostrar últimos controles paciente");

        botonAceptaRutMuestraControles.setText("aceptar");
        botonAceptaRutMuestraControles.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAceptaRutMuestraControlesActionPerformed(evt);
            }
        });

        botonCancelaRutUltimosControles.setText("cancelar");
        botonCancelaRutUltimosControles.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonCancelaRutUltimosControlesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(jLabel16)
                .addGap(18, 18, 18)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel17)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(cajaFiltraRutTratamientos, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(botonAceptaRutMuestraControles)
                        .addGap(10, 10, 10)
                        .addComponent(botonCancelaRutUltimosControles)))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel19Layout.createSequentialGroup()
                .addComponent(jLabel17)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cajaFiltraRutTratamientos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16)
                    .addComponent(botonAceptaRutMuestraControles)
                    .addComponent(botonCancelaRutUltimosControles))
                .addGap(21, 21, 21))
        );

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel7.setText("Mostrar Datos");

        jButton1.setText("todos los clientes");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("todos los pacientes");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(112, 112, 112)
                        .addComponent(jLabel5)
                        .addGap(26, 26, 26)
                        .addComponent(cajaRutClienteRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(46, 46, 46)
                        .addComponent(jLabel6)
                        .addGap(18, 18, 18)
                        .addComponent(cajaNombrePaciente, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(35, 35, 35)
                        .addComponent(botonAceptarNuevoControl)
                        .addGap(18, 18, 18)
                        .addComponent(botonCancelarNuevoControl))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(76, 76, 76)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(283, 283, 283)
                        .addComponent(jLabel4))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addGap(73, 73, 73)
                                .addComponent(jLabel7))
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addGap(26, 26, 26)
                                .addComponent(jButton1)
                                .addGap(18, 18, 18)
                                .addComponent(jButton2)))
                        .addGap(42, 42, 42)
                        .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(35, 35, 35)
                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1327, Short.MAX_VALUE)))
                .addContainerGap(20, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cajaRutClienteRegistro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6)
                    .addComponent(cajaNombrePaciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botonAceptarNuevoControl)
                    .addComponent(botonCancelarNuevoControl))
                .addGap(33, 33, 33)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(14, 14, 14)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 9, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addGap(28, 28, 28)
                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jButton1)
                                    .addComponent(jButton2)))))
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(113, 113, 113))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 577, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("REGISTRO CONTROLES", jPanel6);

        jPanel5.setBackground(new java.awt.Color(244, 241, 226));
        jPanel5.setMaximumSize(new java.awt.Dimension(1024, 768));

        jPanel4.setBackground(new java.awt.Color(255, 255, 255));
        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel2.setText("REGISTRO DE DATOS NUEVO CLIENTE VETERINARIA EL PELUCA");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(479, 479, 479)
                .addComponent(jLabel2)
                .addContainerGap(548, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jLabel2)
                .addContainerGap(28, Short.MAX_VALUE))
        );

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setForeground(new java.awt.Color(255, 255, 255));

        jPanel14.setBackground(new java.awt.Color(255, 255, 255));

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel26.setText("Datos Propietario");

        jLabel44.setText("Nombre:");

        jLabel55.setText("Ap. Paterno:");

        jLabel56.setText("Ap. Materno:");

        jLabel45.setText("Rut:");

        cajaRutPropMasc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cajaRutPropMascActionPerformed(evt);
            }
        });

        jLabel47.setText("Dirección:");

        jLabel57.setText("Teléfono:");

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel45)
                    .addComponent(jLabel44)
                    .addComponent(jLabel55)
                    .addComponent(jLabel56)
                    .addComponent(jLabel47)
                    .addComponent(jLabel57))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel26)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(cajaApPaternoPropMasc)
                        .addComponent(CajaNombreProp)
                        .addComponent(cajaApMaternoPropMasc, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(cajaDireccionPropMasc)
                        .addComponent(cajaRutPropMasc)
                        .addComponent(cajaTelefonoPropMasc)))
                .addContainerGap(86, Short.MAX_VALUE))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jLabel26)
                .addGap(35, 35, 35)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(CajaNombreProp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel44))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel55)
                    .addComponent(cajaApPaternoPropMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel56)
                    .addComponent(cajaApMaternoPropMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cajaRutPropMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel45))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel47)
                    .addComponent(cajaDireccionPropMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel57)
                    .addComponent(cajaTelefonoPropMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );

        jPanel8.setBackground(new java.awt.Color(255, 255, 255));

        jLabel23.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel23.setText("Datos Mascota");

        jLabel27.setText("Nombre:");

        jLabel48.setText("Raza:");

        jLabel58.setText("Edad:");

        jLabel18.setText("Alimentación:");

        jLabel28.setText("Vacunas:");

        jLabel49.setText("Inscrito:");

        selectorInscritoMasc.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));

        selectorVacunasMasc.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));

        selectorTipoEdadMasc.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "meses", "años" }));

        jLabel1.setText("Tipo animal:");

        selectorTipoAnimal.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mascota", "Granja" }));

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel27)
                            .addComponent(jLabel48)
                            .addComponent(jLabel58)
                            .addComponent(jLabel18)
                            .addComponent(jLabel28))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel8Layout.createSequentialGroup()
                                .addComponent(selectorVacunasMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(28, 28, 28)
                                .addComponent(jLabel49)
                                .addGap(18, 18, 18)
                                .addComponent(selectorInscritoMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(cajaAlimMasc, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                            .addComponent(CajaNombreMasc, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                            .addGroup(jPanel8Layout.createSequentialGroup()
                                .addComponent(cajaEdadMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
                                .addComponent(selectorTipoEdadMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(cajaRazaMasc, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
                            .addComponent(selectorTipoAnimal, 0, 255, Short.MAX_VALUE))
                        .addGap(43, 43, 43))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addContainerGap())))
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(136, 136, 136)
                .addComponent(jLabel23)
                .addContainerGap(139, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CajaNombreMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cajaRazaMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel48))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cajaEdadMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(selectorTipoEdadMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel58))
                .addGap(13, 13, 13)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cajaAlimMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(selectorTipoAnimal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(selectorVacunasMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28)
                    .addComponent(jLabel49)
                    .addComponent(selectorInscritoMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanel16.setBackground(new java.awt.Color(254, 254, 254));

        jLabel68.setText("Total Consulta:");

        jLabel69.setText("Forma de pago:");

        selectorFormaPagoMasc.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "efectivo", "cheque", "tarjeta crédito" }));

        jLabel70.setText("Fecha emisión:");

        jLabel71.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
        jLabel71.setText("¿Ingresar Paciente?");

        aceptarRegistroMasc.setText("aceptar");
        aceptarRegistroMasc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarRegistroMascActionPerformed(evt);
            }
        });

        jButton12.setText("cancelar");
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
                .addContainerGap(23, Short.MAX_VALUE)
                .addComponent(jLabel68)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cajaTotalConsultaMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel69)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(selectorFormaPagoMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(jLabel70)
                .addGap(18, 18, 18)
                .addComponent(cajaFechaFacturaMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel71)
                .addGap(36, 36, 36)
                .addComponent(aceptarRegistroMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton12, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(41, 41, 41))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel69)
                    .addComponent(selectorFormaPagoMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel70)
                    .addComponent(cajaFechaFacturaMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel71)
                    .addComponent(aceptarRegistroMasc)
                    .addComponent(jButton12)
                    .addComponent(cajaTotalConsultaMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel68))
                .addGap(67, 67, 67))
        );

        jPanel15.setBackground(new java.awt.Color(255, 255, 255));

        jLabel59.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
        jLabel59.setText("Fecha tratamiento");

        jLabel60.setText("Inicio:");

        jLabel61.setText("Descripción");

        jLabel62.setText("tratamiento");

        campoDescr.setColumns(20);
        campoDescr.setRows(5);
        jScrollPane7.setViewportView(campoDescr);

        jLabel63.setText("Término:");

        aceptarNroMedMasc.setText("si");
        aceptarNroMedMasc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarNroMedMascActionPerformed(evt);
            }
        });

        jLabel12.setText("¿ingresar medicamentos?");

        botonNoIngresaMed.setText("no");
        botonNoIngresaMed.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonNoIngresaMedActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel15Layout.createSequentialGroup()
                            .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel62)
                                .addComponent(jLabel61)
                                .addComponent(jLabel60))
                            .addGap(6, 6, 6)
                            .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel15Layout.createSequentialGroup()
                                    .addComponent(cajaFechaInicioTratMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(jLabel63)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(cajaFechaTerTratMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 349, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addContainerGap(19, Short.MAX_VALUE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                            .addComponent(jLabel59)
                            .addGap(143, 143, 143)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addGap(18, 18, 18)
                        .addComponent(aceptarNroMedMasc, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(botonNoIngresaMed, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(91, 91, 91))))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(jLabel59)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel60)
                    .addComponent(cajaFechaInicioTratMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel63)
                    .addComponent(cajaFechaTerTratMasc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addGap(55, 55, 55)
                        .addComponent(jLabel61)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel62))
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(aceptarNroMedMasc)
                    .addComponent(botonNoIngresaMed))
                .addGap(28, 28, 28))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(35, 35, 35)
                        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(75, 75, 75)
                        .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(133, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 50, Short.MAX_VALUE)
                .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(35, 35, 35))
        );

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1349, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 119, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jTabbedPane1.addTab("NUEVO REGISTRO CLIENTES", jPanel5);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 693, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void aceptarNroMedMascActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarNroMedMascActionPerformed

        this.agregarMedicamentosNuevoRegistro();
}//GEN-LAST:event_aceptarNroMedMascActionPerformed

    private void aceptarRegistroMascActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarRegistroMascActionPerformed

        this.agregarMascota();
}//GEN-LAST:event_aceptarRegistroMascActionPerformed

    private void cajaRutPropMascActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cajaRutPropMascActionPerformed
}//GEN-LAST:event_cajaRutPropMascActionPerformed

    private void aceptarNroMedMasc1NuevoControlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarNroMedMasc1NuevoControlActionPerformed

        this.agregarMedicamentosNuevoControl();
    }//GEN-LAST:event_aceptarNroMedMasc1NuevoControlActionPerformed

    private void aceptarRegistroMasc1NuevoControlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarRegistroMasc1NuevoControlActionPerformed

        this.ingresarConsultaPaciente();
    }//GEN-LAST:event_aceptarRegistroMasc1NuevoControlActionPerformed

    private void botonAceptarNuevoControlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAceptarNuevoControlActionPerformed

        this.agregarNuevoControl();

    }//GEN-LAST:event_botonAceptarNuevoControlActionPerformed

    private void botonCancelarNuevoControlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonCancelarNuevoControlActionPerformed

        this.cancelarNuevoControl();
    }//GEN-LAST:event_botonCancelarNuevoControlActionPerformed

    private void cajaTotalConsultaMasc1NuevoControlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cajaTotalConsultaMasc1NuevoControlActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cajaTotalConsultaMasc1NuevoControlActionPerformed

    private void botonNoIngresaMedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonNoIngresaMedActionPerformed

        this.noIngresaMedNuevoCliente();
        // TODO add your handling code here:
    }//GEN-LAST:event_botonNoIngresaMedActionPerformed

    private void botonNoIngresaMedNuevoControlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonNoIngresaMedNuevoControlActionPerformed

        this.noIngresaMedicamentosControl();
        // TODO add your handling code here:
    }//GEN-LAST:event_botonNoIngresaMedNuevoControlActionPerformed

    private void botonAceptarOpcionesEdicionDatosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAceptarOpcionesEdicionDatosActionPerformed

        this.selecciónEdicion();
        // TODO add your handling code here:
    }//GEN-LAST:event_botonAceptarOpcionesEdicionDatosActionPerformed

    private void BotonCancelarOpcionesRegistroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonCancelarOpcionesRegistroActionPerformed

        this.cancelarEdicionDatos();
        // TODO add your handling code here:
    }//GEN-LAST:event_BotonCancelarOpcionesRegistroActionPerformed

    private void botonAceptaRutMuestraControlesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAceptaRutMuestraControlesActionPerformed

        this.mostrarUltimosControlesPacientes();
        // TODO add your handling code here:
    }//GEN-LAST:event_botonAceptaRutMuestraControlesActionPerformed

    private void botonCancelaRutUltimosControlesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonCancelaRutUltimosControlesActionPerformed

        this.cancelarFiltroBusquedaControles();
        // TODO add your handling code here:
    }//GEN-LAST:event_botonCancelaRutUltimosControlesActionPerformed

    private void cancelarNuevoControlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelarNuevoControlActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cancelarNuevoControlActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        this.mostrarTodosLosClientes();
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void cajaRutClienteRegistroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cajaRutClienteRegistroActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_cajaRutClienteRegistroActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed

        this.mostrarTodosLosPacientes();

        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed

        this.limpiarTodo();

        // TODO add your handling code here:
    }//GEN-LAST:event_jButton12ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotonCancelarOpcionesRegistro;
    private javax.swing.JTextField CajaNombreMasc;
    private javax.swing.JTextField CajaNombreProp;
    private javax.swing.JButton aceptarNroMedMasc;
    private javax.swing.JButton aceptarNroMedMasc1NuevoControl;
    private javax.swing.JButton aceptarRegistroMasc;
    private javax.swing.JButton aceptarRegistroMasc1NuevoControl;
    private javax.swing.JButton botonAceptaRutMuestraControles;
    private javax.swing.JButton botonAceptarNuevoControl;
    private javax.swing.JButton botonAceptarOpcionesEdicionDatos;
    private javax.swing.JButton botonCancelaRutUltimosControles;
    private javax.swing.JButton botonCancelarNuevoControl;
    private javax.swing.JButton botonNoIngresaMed;
    private javax.swing.JButton botonNoIngresaMedNuevoControl;
    private javax.swing.JTextField cajaAlimMasc;
    private javax.swing.JTextField cajaApMaternoPropMasc;
    private javax.swing.JTextField cajaApPaternoPropMasc;
    private javax.swing.JTextField cajaDireccionPropMasc;
    private javax.swing.JTextField cajaEdadMasc;
    private javax.swing.JTextField cajaFechaFacturaMasc;
    private javax.swing.JTextField cajaFechaFacturaMasc1NuevoControl;
    private javax.swing.JTextField cajaFechaInicioTratMasc;
    private javax.swing.JTextField cajaFechaInicioTratMasc1NuevoControl;
    private javax.swing.JTextField cajaFechaTerTratMasc;
    private javax.swing.JTextField cajaFechaTerTratMasc1NuevoControl;
    private javax.swing.JTextField cajaFiltraRutTratamientos;
    private javax.swing.JTextField cajaNombrePaciente;
    private javax.swing.JTextField cajaRazaMasc;
    private javax.swing.JTextField cajaRutClienteRegistro;
    private javax.swing.JTextField cajaRutEdiciónDatos;
    private javax.swing.JTextField cajaRutPropMasc;
    private javax.swing.JTextField cajaTelefonoPropMasc;
    private javax.swing.JTextField cajaTotalConsultaMasc;
    private javax.swing.JTextField cajaTotalConsultaMasc1NuevoControl;
    private javax.swing.JTextArea campoDescr;
    private javax.swing.JTextArea campoDescrNuevoControl;
    private javax.swing.JButton cancelarNuevoControl;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel68;
    private javax.swing.JLabel jLabel69;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel70;
    private javax.swing.JLabel jLabel71;
    private javax.swing.JLabel jLabel73;
    private javax.swing.JLabel jLabel74;
    private javax.swing.JLabel jLabel75;
    private javax.swing.JLabel jLabel76;
    private javax.swing.JLabel jLabel77;
    private javax.swing.JLabel jLabel81;
    private javax.swing.JLabel jLabel82;
    private javax.swing.JLabel jLabel83;
    private javax.swing.JLabel jLabel84;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JComboBox selectorFormaPagoMasc;
    private javax.swing.JComboBox selectorFormaPagoMasc1NuevoControl;
    private javax.swing.JComboBox selectorInscritoMasc;
    private javax.swing.JComboBox selectorOpcionesRegistro;
    private javax.swing.JComboBox selectorTipoAnimal;
    private javax.swing.JComboBox selectorTipoEdadMasc;
    private javax.swing.JComboBox selectorVacunasMasc;
    // End of variables declaration//GEN-END:variables

    /******************************************************** PESTAÑA INGRESO MASCOTA ************************************************/
    private void agregarMascota() {

        //datos del propietario
        String nombreProp = CajaNombreProp.getText().toUpperCase();
        String apPaterno = cajaApPaternoPropMasc.getText().toUpperCase();
        String apMaterno = cajaApMaternoPropMasc.getText().toUpperCase();
        String rut = cajaRutPropMasc.getText().toLowerCase();

        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rut);

        finale = validaRut.getRutPropietarioMasc();
        String RutNuevoRegistro = finale.toString();

        String direccion = cajaDireccionPropMasc.getText().toUpperCase().replace(" ", "_");
        String telefono = cajaTelefonoPropMasc.getText().toUpperCase();

        Propietario prop = new Propietario(nombreProp, apPaterno, apMaterno, RutNuevoRegistro, direccion, telefono);

        //datos de la mascota
        String nombreMasc = CajaNombreMasc.getText().toUpperCase();
        String razaMasc = cajaRazaMasc.getText().toUpperCase();
        int edad = Integer.parseInt(cajaEdadMasc.getText());
        String tipoEdad = (String) selectorTipoEdadMasc.getSelectedItem();
        String alimentacion = cajaAlimMasc.getText().toUpperCase();
        String tipoAnimal = (String) selectorTipoAnimal.getSelectedItem();
        String inscrito = (String) selectorInscritoMasc.getSelectedItem();
        String vacunas = (String) selectorVacunasMasc.getSelectedItem();

        //Tratamiento Mascota
        String fechaIni = cajaFechaInicioTratMasc.getText();
        val.ConversorAmericanoFechaInicio(fechaIni);
        String fechaIniFinal = val.getFechaInicioTratamiento();

        String fechaTer = cajaFechaTerTratMasc.getText();
        val.ConversorAmericanoFechaTermino(fechaTer);
        String fechaTerminoFinal = val.getFechaTerminoTratamiento();

        String descripcion = campoDescr.getText();

        //costos consulta
        float costoConsultaMasc = Float.parseFloat(cajaTotalConsultaMasc.getText());
        String formaPagoConsMasc = (String) selectorFormaPagoMasc.getSelectedItem();
        String fechaPago = cajaFechaFacturaMasc.getText();

        val.ConversorAmericanoFechaInicio(fechaPago);
        String fechaPagoAmericana = val.getFechaInicioTratamiento();

        //inserta datos en la base de datos
        InsertInputData.InsertarDatosCliente(RutNuevoRegistro, nombreProp, apPaterno, apMaterno, direccion, telefono);
        InsertInputData.InsertarDatosPaciente(RutNuevoRegistro, nombreMasc, edad, tipoEdad);
        InsertInputData.InsertarDatosTablaRaza(RutNuevoRegistro, razaMasc);
        InsertInputData.InsertarDatosTablaTipoAnimal(RutNuevoRegistro, tipoAnimal);
        InsertInputData.InsertarDatosTablaRegistro(RutNuevoRegistro);
        InsertInputData.InsertarDatosTablaTratamiento(RutNuevoRegistro, fechaIniFinal, fechaTerminoFinal, descripcion, nombreMasc);
        InsertInputData.InsertarDatosTablaCostosConsulta(RutNuevoRegistro, costoConsultaMasc, formaPagoConsMasc, fechaPagoAmericana, nombreMasc);

        CajaNombreProp.setText("");
        cajaApPaternoPropMasc.setText("");
        cajaApMaternoPropMasc.setText("");
        cajaRutPropMasc.setText("");
        cajaDireccionPropMasc.setText("");
        cajaTelefonoPropMasc.setText("");
        CajaNombreMasc.setText("");
        cajaRazaMasc.setText("");
        cajaEdadMasc.setText("");
        cajaAlimMasc.setText("");
        cajaFechaInicioTratMasc.setText("");
        cajaFechaTerTratMasc.setText("");
        campoDescr.setText("");
        cajaTotalConsultaMasc.setText("");
        cajaFechaFacturaMasc.setText("");
    }

    private void agregarMedicamentosNuevoRegistro() {

        String rutMed = cajaRutPropMasc.getText().toLowerCase();
        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rutMed);
        finale = validaRut.getRutPropietarioMasc();
        String RutNuevoRegistro = finale.toString();

        String nombreMasc = CajaNombreMasc.getText().toUpperCase();

        AgregaMed emergente = new AgregaMed();
        emergente.setVisible(true);
        emergente.setLocationRelativeTo(null);
        emergente.obtieneNombrePaciente(nombreMasc);

        emergente.ObitieneRut(RutNuevoRegistro);
    }

    /***************************************************** PESTAÑA REGISTRO CONTROLES ****************************************************/
    private void agregarNuevoControl() {

        rutNuevoControl = cajaRutClienteRegistro.getText();
        nombrePacienteNuevoControl = cajaNombrePaciente.getText();

        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rutNuevoControl);

        finale = validaRut.getRutPropietarioMasc();
        String RutNuevoControlFinal = finale.toString();
        String nombreAnimal = cajaNombrePaciente.getText().toUpperCase();

        muestra.MostrarResultadosConsulta(RutNuevoControlFinal, nombreAnimal);
    }

    private void ingresarConsultaPaciente() {

        /************************************ RUT NUEVO CONTROL ************************************/
        String rutNuevo = cajaRutClienteRegistro.getText().toUpperCase();
        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rutNuevo);
        finale = validaRut.getRutPropietarioMasc();
        String RutNuevoRegistro = finale.toString();

        /********************************** NOMBRE ANIMAL NUEVO CONTROL ***************************/
        String nombreAnimal = cajaNombrePaciente.getText().toUpperCase();

        /********************************* FECHA INICIO NUEVO TRATAMIENTO ************************/
        String fechaIniNuevoControl = cajaFechaInicioTratMasc1NuevoControl.getText();
        val.ConversorAmericanoFechaInicio(fechaIniNuevoControl);
        String FechaIniNuevoControlBD = val.getFechaInicioTratamiento();

        /********************************* FECHA TERMINO NUEVO TRATAMIENTO ************************/
        String fechaTerNuevoControl = cajaFechaTerTratMasc1NuevoControl.getText();
        val.ConversorAmericanoFechaTermino(fechaTerNuevoControl);
        String FechaTerNuevoControlBD = val.getFechaTerminoTratamiento();

        /********************************* DESCRIPCION NUEVO TRATAMIENTO ************************/
        String descripcionNuevoControl = campoDescrNuevoControl.getText();

        /********************************* COSTO NUEVO TRATAMIENTO ************************/
        float totalNuevaConsulta = Float.parseFloat(cajaTotalConsultaMasc1NuevoControl.getText());

        /********************************* FORMA PAGO NUEVO TRATAMIENTO ************************/
        String formaPagoNuevaConsulta = (String) selectorFormaPagoMasc1NuevoControl.getSelectedItem();

        /********************************* FECHA PAGO NUEVO TRATAMIENTO ************************/
        String fechaEmisionPagoNuevaConsulta = cajaFechaFacturaMasc1NuevoControl.getText();
        val.ConversorAmericanoFechaInicio(fechaEmisionPagoNuevaConsulta);
        String FechaEmisionPagoNuevaConsultaBD = val.getFechaInicioTratamiento();


        InsertInputData.InsertarDatosTablaTratamiento(RutNuevoRegistro, FechaIniNuevoControlBD, FechaTerNuevoControlBD, descripcionNuevoControl, nombreAnimal);
        InsertInputData.InsertarDatosTablaCostosConsulta(RutNuevoRegistro, totalNuevaConsulta, formaPagoNuevaConsulta, FechaEmisionPagoNuevaConsultaBD, nombreAnimal);
    }

    private void agregarMedicamentosNuevoControl() {

        String rutMed = cajaRutClienteRegistro.getText().toLowerCase();
        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rutMed);
        finale = validaRut.getRutPropietarioMasc();
        String RutNuevoRegistro = finale.toString();

        String nombreRegistro = cajaNombrePaciente.getText().toUpperCase();

        AgregaMed emergente = new AgregaMed();
        emergente.setVisible(true);
        emergente.setLocationRelativeTo(null);
        emergente.obtieneNombrePaciente(nombreRegistro);

        emergente.ObitieneRut(RutNuevoRegistro);
    }

    private void noIngresaMedicamentosControl() {

        String rutMed = cajaRutClienteRegistro.getText().toLowerCase();
        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rutMed);
        finale = validaRut.getRutPropietarioMasc();
        String RutNuevoRegistro = finale.toString();

        AgregaMed noAgrega = new AgregaMed();
        String nombreNoAgrega = cajaNombrePaciente.getText().toUpperCase();

        noAgrega.noIngresaMed(RutNuevoRegistro, nombreNoAgrega);
    }

    private void cancelarNuevoControl() {

        cajaRutClienteRegistro.setText("");
        cajaNombrePaciente.setText("");
    }

    /******************************************************* PESTAÑA CONSULTAS *****************************************************/
    private void selecciónEdicion() {

        String RutEdiciónDatos = cajaRutEdiciónDatos.getText();
        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(RutEdiciónDatos);
        finale = validaRut.getRutPropietarioMasc();
        rutClienteEditable = finale.toString();

        String seleccion = (String) selectorOpcionesRegistro.getSelectedItem();

        if (seleccion.equals("editar datos cliente")) {

            edicionDatosCliente edita = new edicionDatosCliente();
            edita.setVisible(true);
            edita.setLocationRelativeTo(null);
            edita.obtieneRut(rutClienteEditable);
            cajaRutEdiciónDatos.setText("");
        } else if (seleccion.equals("editar datos paciente")) {

            EdicionDatosAnimal editaAnimal = new EdicionDatosAnimal();
            editaAnimal.setVisible(true);
            editaAnimal.setLocationRelativeTo(null);
            editaAnimal.obtieneRut(rutClienteEditable);
            cajaRutEdiciónDatos.setText("");

        } else if (seleccion.equals("eliminar registros")) {

            InsertInputData.BorrarDatosTablaPropietario(rutClienteEditable);
            InsertInputData.BorrarDatosTablaTipoAnimal(rutClienteEditable);
            InsertInputData.BorrarDatosTablaRaza(rutClienteEditable);
            InsertInputData.BorrarDatosTablaAnimal(rutClienteEditable);
            InsertInputData.BorrarDatosTablaRegistro(rutClienteEditable);
            InsertInputData.BorrarDatosTablaTratamiento(rutClienteEditable);
            InsertInputData.BorrarDatosTablaMedicamento(rutClienteEditable);
            InsertInputData.BorrarDatosTablaCostosConsulta(rutClienteEditable);
            cajaRutEdiciónDatos.setText("");
            JOptionPane.showMessageDialog(null, "DATOS ELIMINADOS CORRECTAMENTE");

        }
    }

    private void mostrarUltimosControlesPacientes() {

        String rutFiltro = cajaFiltraRutTratamientos.getText();

        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rutFiltro);

        finale = validaRut.getRutPropietarioMasc();
        rutClienteEditable = finale.toString();

        muestra.mostrarUltimosControles(rutClienteEditable);

    }

    private void cancelarFiltroBusquedaControles() {

        cajaFiltraRutTratamientos.setText("");
    }

    /******************************************* GETTERS ********************************************************/
    public StringBuilder getFinale() {
        return finale;
    }

    private void cancelarEdicionDatos() {

        cajaRutEdiciónDatos.setText("");
    }

    private void noIngresaMedNuevoCliente() {

        String rutMed = cajaRutPropMasc.getText().toLowerCase();
        validacionRutBD validaRut = new validacionRutBD();
        validaRut.valida(rutMed);
        finale = validaRut.getRutPropietarioMasc();
        String RutNuevoRegistro = finale.toString();

        String nombreAnimalPaciente = CajaNombreMasc.getText().toUpperCase();

        AgregaMed noAgrega = new AgregaMed();
        noAgrega.noIngresaMed(RutNuevoRegistro, nombreAnimalPaciente);

    }

    private void mostrarTodosLosClientes() {

        muestra.mostrarTodosLosClientes();
    }

    private void mostrarTodosLosPacientes() {

        muestra.mostrarTodosLosPacientes();
    }

    private void limpiarTodo() {

         CajaNombreProp.setText("");
        cajaApPaternoPropMasc.setText("");
        cajaApMaternoPropMasc.setText("");
        cajaRutPropMasc.setText("");
        cajaDireccionPropMasc.setText("");
        cajaTelefonoPropMasc.setText("");
        CajaNombreMasc.setText("");
        cajaRazaMasc.setText("");
        cajaEdadMasc.setText("");
        cajaAlimMasc.setText("");
        cajaFechaInicioTratMasc.setText("");
        cajaFechaTerTratMasc.setText("");
        campoDescr.setText("");
        cajaTotalConsultaMasc.setText("");
        cajaFechaFacturaMasc.setText("");

    }


}
